package com.example.exception;

/**
 * @title: ServiceException
 * @Author wjf
 * @Date: 2022/9/22 15:49
 * @Version 1.0
 */

import com.example.until.ResultCodeEnum;
import lombok.Getter;
import lombok.Setter;

/**
 * 自定义异常
 */
@Getter
@Setter
public class ServiceException extends RuntimeException {
    private Integer code;

    public ServiceException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }
}
